<%@page import="com.swt.mto.thithu.service.QuestionLocalServiceUtil"%>
<%@page import="com.swt.mto.thithu.model.Question"%>
<%@page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>			
		
<portlet:defineObjects />
<script type="text/javascript">		
	$(document).ready(function(){
		$("#addNewQuiz").click(function(){
			var result = "";
			result += "<li>";
			result +=	    "<div class=\"availableQuizItem\">";
			result +=       "<div class=\"itemHeader\">";
			result +=            "<div class=\"quizItemTitle\">New quiz</div>";
			result +=            "<abbr title=\"Remove\">";
			result +=                "<button id=\"quizDelete\" class=\"button28 removeQuizButton buttonRemove\"></button>";
			result +=            "</abbr>";
			result +=            "<abbr title=\"Edit\">";
			result +=                "<button id=\"quizEdit\" class=\"button28 removeQuizButton buttonEdit\">Edit</button>";
			result +=            "</abbr>";
			result +=            "<div style=\"clear\:both\"></div>";
			result +=        "</div>";
			result +=        "<div class=\"itemBody\">";
			result +=            "<div class=\"quizBodyContent\">";
			result +=                "<div>";
			result +=                    "<div class=\"quizSection\">";
			result +=                       "<div class=\"quizSectionTitle quizQuestionAmount\">0";
			result +=                           "questions selected.";
			result +=                        "</div>";
			result +=                        "<abbr title=\"Add questions\">";
			result +=                            "<button id=\"buttonOpen\" class=\"button24x18 buttonList editQuestionsButton\"></button>";
			result +=                        "</abbr>";
			result +=                        "<div style=\"clear\:both\"></div>";
			result +=                    "</div>";
			result +=                    "<div class=\"quizSection\">";
			result +=                        "<div class=\"quizSectionTitle\">Description</div>";
			result +=                       "<div style=\"clear\:both\"></div>";
			result +=                    "</div>";
			result +=                    "<div id=\"SCORMCategoryDescription\" class=\"SCORMResult\">Quiz info</div>";
			result +=                "</div>";			    

			result +=                "<div style=\"clear\:both\"></div>";
			result +=            "</div>";
			result +=        "</div>";
			result +=    "</div>";
			result +="</li>";
			
			$("ul#quizList").prepend(result);
		});
	});
</script>
<portlet:actionURL name="getQuestion" var="getques">

</portlet:actionURL>
<%
	List<Question> questions = QuestionLocalServiceUtil.getQuestions(0, 2);
	for(Question question : questions){
%>
		<a><%=question.getQuestionId() %></a>
	<%} %>

<div class="projectLearnGeneric" id="projectLearnGeneric">
    <div class="SCORMTitle">Quiz Editor</div>
    <br clear="all"/>

	<div id="quizList">
		<ul class="quizList" id="quizList">
		</ul>
	</div>
    <button id="addNewQuiz">Add New Quiz</button>
   
</div>